<?php defined('IN_YuLin') || exit('NO PERMIT!'); ?>
{template member/header}

	<input type="hidden" id="hdErrMsg" />
	<div class="main-head">
		<span>用户中心 &gt; 报表管理 &gt; 帐变报表</span>
	</div>
	<div class="con_box">
		<form id="form1" action="?" method="get">
			<input type="hidden" name="m" value="{$m}" />
			<input type="hidden" name="c" value="{$c}" />
			<input type="hidden" name="a" value="{$a}" />
			<div class="form-box">
				<span>
					时间：
					<input type="text" id="dtrange" name="dtrange" value="{$dtrange}" class="dtrange" readonly="readonly">
				</span>
				<span><a href="javascript:void(0)" class="btn" data-bind="click:searchData">查询</a></span>
			</div>
			
			<div class="form-box">
				<div style="padding:5px 10px;background:#fff;border-radius:6px;border:1px solid #d4d4d4;margin:10px 0 0 0;line-height:2">
					类型：
					<label><input type="checkbox" value="0" id="checkAllType" />所有类型</label>
					<div id="typeItems">
						<font class="red">收入：</font>
						<label style="padding:0 5px;"><input type="checkbox" name="tids[]" value="recharge"{if in_array('recharge',$tids)} checked="checked"{/if} />充值</label>
						<label style="padding:0 5px;"><input type="checkbox" name="tids[]" value="agent"{if in_array('agent',$tids)} checked="checked"{/if} />代理提成</label>
						<label style="padding:0 5px;"><input type="checkbox" name="tids[]" value="prize"{if in_array('prize',$tids)} checked="checked"{/if} />彩票中奖</label>
						<label style="padding:0 5px;"><input type="checkbox" name="tids[]" value="order_cancel"{if in_array('order_cancel',$tids)} checked="checked"{/if} />撤销下注</label>
						<label style="padding:0 5px;"><input type="checkbox" name="tids[]" value="order_back"{if in_array('order_back',$tids)} checked="checked"{/if} />投注返点</label>
						<br />
						<font class="red">支出：</font>
						<label style="padding:0 5px;"><input type="checkbox" name="tids[]" value="cash"{if in_array('cash',$tids)} checked="checked"{/if} />提现</label>
						<label style="padding:0 5px;"><input type="checkbox" name="tids[]" value="order_add"{if in_array('order_add',$tids)} checked="checked"{/if} />下注</label>
					</div>
				</div>
			</div>
		</form>
		<div class="table-list">
			<table>
				<thead>
					<tr>
						<th>时间</th>
						<th>帐变类型</th>
						<th>支出</th>
						<th>收入</th>
						<th>余额</th>
						<th>备注</th>
					</tr>
				</thead>
				<tbody>
					{if $data}
						{loop $data as $val}
						<tr>
							<td>{date('Y-m-d',$val['dateline'])}</td>
							<td>{$val['name']}</td>
							<td>{_e $val['expend'] ? $val['expend'] : '-'}</td>
							<td>{_e $val['income'] ? $val['income'] : '-'}</td>
							<td>{$val['total']}</td>
							<td>{$val['notes']}</td>
						</tr>
						{/loop}
					{else}
						<tr>
							<td colspan="6">请选择查询条件之后进行查询</td>
						</tr>
					{/if}
				</tbody>
				{if $data}
				<tfoot>
					<tr style="font-weight:bold">
						<td colspan="2">小计{count($data)}笔</td>
						<td><font color="red">总支出:{$num['expend']}</font></td>
						<td>总收入:{$num['income']}</td>
						<td colspan="2"></td>
					</tr>
					<tr style="font-weight:bold">
						<td colspan="2">总计{$total}笔</td>
						<td><font color="red">总支出:{$num['expend2']}</font></td>
						<td>总收入:{$num['income2']}</td>
						<td colspan="2"></td>
					</tr>
				</tfoot>
				{/if}
			</table>
			<div class="page">
				<span class="page-inner">{$multi}</span>
			</div>
		</div>
	</div>
	<script src="static/js/TeamReport.js"></script>
	<script src="static/js/laydate/laydate.js"></script>
	<script>
		$().ready(function(){
			laydate.render({
				elem: '#dtrange',
				range: true
			});
			
			$("#checkAllType").click(function () {
				$("#typeItems input").prop('checked', $(this).is(':checked'));
			});
		});
	</script>
	
    <div id="SEARCH-TIP" style="display:none;">
        <div class="mask"></div>
        <div class="popup tips-popup">
            <div class="popup-head">
                <span>提示</span>
            </div>
            <div class="popup-body">
                <p>查询中,请您耐心等待.....</p>
            </div>
        </div>
    </div>

{template member/footer}